package application;


/**
 * This class represents Shutdown Hook mechanism which supports JVM exit handling.
 * 
 * @author Uros Krkic
 */
public class ShutdownHook extends Thread {
	
	private ApplicationInterface managedClass;

	
	public ShutdownHook(ApplicationInterface managedClass) {
		super();
		this.managedClass = managedClass;
	}

	public void run() {
		try {
			managedClass.freeResources();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
